//
//  Common.swift
//  Weibo
//
//  Created by 唐润欣 on 16/6/18.
//  Copyright © 2016年 唐润欣. All rights reserved.
//

import UIKit
import SDWebImage
import SnapKit

/// 全局使用的frame
let screenBounds = UIScreen.mainScreen().bounds
let screenWidth = UIScreen.mainScreen().bounds.size.width
let screenScale = UIScreen.mainScreen().scale
let screenHeight = UIScreen.mainScreen().bounds.size.height

/// 全局颜色
let globalColor = UIColor.orangeColor()

/// 登录、授权成功通知字符串
let oauthSuccessNotification = "oauthDidSuccessNotification"

///  延迟加载
///
///  - parameter dealy:    延迟多少秒
///  - parameter clousure: 延迟操作的闭包
func delay(delay: Double, clousure: () ->()) {
    
    let dispatch_delay = dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC)))
    
    dispatch_after(dispatch_delay, dispatch_get_main_queue()) {
        
        clousure()
    }
}
